remove g_assert_not_reached() that was bogus, since we demand-create the
authorHavoc Pennington <hp@redhat.com>
Wed, 5 Dec 2001 01:43:48 +0000 (01:43 +0000)
committerHavoc Pennington <hp@src.gnome.org>
Wed, 5 Dec 2001 01:43:48 +0000 (01:43 +0000)
2001-12-04  Havoc Pennington  <hp@redhat.com>

* gtk/gtktextbtree.c (gtk_text_btree_remove_tag_info): remove
g_assert_not_reached() that was bogus, since we demand-create the
tag info. reported by Chris Phelps

        Jump through assorted hoops to fix bug from Chris Phelps where
removing tags from the table resulted in btree trying to
access tag->table

* gtk/gtktextbuffer.c: set up mechanics of adding/removing
ourselves to the tag table

* gtk/gtktexttagtable.c (_gtk_text_tag_table_add_buffer)
(_gtk_text_tag_table_remove_buffer): private cruft to
let us notify buffer of disappearing tags

* gtk/gtktexttag.h: remove BTreeNode typedef from this public
header, put it in tagprivate

* gtk/gtktextbtree.c (_gtk_text_btree_new): don't connect to
tag_removed; it's emitted too late.
(_gtk_text_btree_notify_will_remove_tag): rename tag_remove_cb to
this

Padding for ABI-compat expansion

* gtk/gtktexttag.h (struct _GtkTextAttributes): pad this
(struct _GtkTextAppearance): one pad in here too

* gtk/gtktextlayout.h (struct _GtkTextLayoutClass): padding here

* gtk/gtktextview.h (struct _GtkTextViewClass): more padding,
since action signals etc. seem pretty likely

* gtk/gtktextbuffer.h (struct _GtkTextBufferClass): padding

* gtk/gtktexttag.h (struct _GtkTextTagClass): padding

* gtk/gtktexttagtable.h (struct _GtkTextTagTableClass): padding

17 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktextbtree.c
gtk/gtktextbtree.h
gtk/gtktextbuffer.c
gtk/gtktextbuffer.h
gtk/gtktextlayout.h
gtk/gtktexttag.h
gtk/gtktexttagprivate.h
gtk/gtktexttagtable.c
gtk/gtktexttagtable.h
gtk/gtktextview.h

index 706e17e4c143c439c91df81cd329b3df1f2b9b4a..aeb804e0d245d49b3b5ef87dd434ae35a926a968 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,44 @@
+2001-12-04  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktextbtree.c (gtk_text_btree_remove_tag_info): remove
+       g_assert_not_reached() that was bogus, since we demand-create the
+       tag info. reported by Chris Phelps
+
+        Jump through assorted hoops to fix bug from Chris Phelps where 
+       removing tags from the table resulted in btree trying to 
+       access tag->table
+       
+       * gtk/gtktextbuffer.c: set up mechanics of adding/removing 
+       ourselves to the tag table
+
+       * gtk/gtktexttagtable.c (_gtk_text_tag_table_add_buffer) 
+       (_gtk_text_tag_table_remove_buffer): private cruft to 
+       let us notify buffer of disappearing tags
+
+       * gtk/gtktexttag.h: remove BTreeNode typedef from this public
+       header, put it in tagprivate    
+
+       * gtk/gtktextbtree.c (_gtk_text_btree_new): don't connect to
+       tag_removed; it's emitted too late.
+       (_gtk_text_btree_notify_will_remove_tag): rename tag_remove_cb to
+       this
+
+       Padding for ABI-compat expansion
+       
+       * gtk/gtktexttag.h (struct _GtkTextAttributes): pad this
+       (struct _GtkTextAppearance): one pad in here too
+
+       * gtk/gtktextlayout.h (struct _GtkTextLayoutClass): padding here
+
+       * gtk/gtktextview.h (struct _GtkTextViewClass): more padding,
+       since action signals etc. seem pretty likely
+
+       * gtk/gtktextbuffer.h (struct _GtkTextBufferClass): padding
+
+       * gtk/gtktexttag.h (struct _GtkTextTagClass): padding
+
+       * gtk/gtktexttagtable.h (struct _GtkTextTagTableClass): padding
+
 2001-12-04  Matthias Clasen  <matthiasc@poet.de>
 
         * gdk/gdkcolor.h (gdk_colormap_change): Deprecate. (#65851)
@@ -26,7 +67,7 @@ Tue Dec  4 18:38:35 2001  Jonathan Blandford  <jrb@redhat.com>
        * gtk/gtktreeviewcolumn.h: ditto
 
 2001-12-04  Havoc Pennington  <hp@redhat.com>
-
+       
        * gtk/gtktexttag.c (gtk_text_tag_set_property): add a warning for
        "invisible" property, #65999
 
index 706e17e4c143c439c91df81cd329b3df1f2b9b4a..aeb804e0d245d49b3b5ef87dd434ae35a926a968 100644 (file)
@@ -1,3 +1,44 @@
+2001-12-04  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktextbtree.c (gtk_text_btree_remove_tag_info): remove
+       g_assert_not_reached() that was bogus, since we demand-create the
+       tag info. reported by Chris Phelps
+
+        Jump through assorted hoops to fix bug from Chris Phelps where 
+       removing tags from the table resulted in btree trying to 
+       access tag->table
+       
+       * gtk/gtktextbuffer.c: set up mechanics of adding/removing 
+       ourselves to the tag table
+
+       * gtk/gtktexttagtable.c (_gtk_text_tag_table_add_buffer) 
+       (_gtk_text_tag_table_remove_buffer): private cruft to 
+       let us notify buffer of disappearing tags
+
+       * gtk/gtktexttag.h: remove BTreeNode typedef from this public
+       header, put it in tagprivate    
+
+       * gtk/gtktextbtree.c (_gtk_text_btree_new): don't connect to
+       tag_removed; it's emitted too late.
+       (_gtk_text_btree_notify_will_remove_tag): rename tag_remove_cb to
+       this
+
+       Padding for ABI-compat expansion
+       
+       * gtk/gtktexttag.h (struct _GtkTextAttributes): pad this
+       (struct _GtkTextAppearance): one pad in here too
+
+       * gtk/gtktextlayout.h (struct _GtkTextLayoutClass): padding here
+
+       * gtk/gtktextview.h (struct _GtkTextViewClass): more padding,
+       since action signals etc. seem pretty likely
+
+       * gtk/gtktextbuffer.h (struct _GtkTextBufferClass): padding
+
+       * gtk/gtktexttag.h (struct _GtkTextTagClass): padding
+
+       * gtk/gtktexttagtable.h (struct _GtkTextTagTableClass): padding
+
 2001-12-04  Matthias Clasen  <matthiasc@poet.de>
 
         * gdk/gdkcolor.h (gdk_colormap_change): Deprecate. (#65851)
@@ -26,7 +67,7 @@ Tue Dec  4 18:38:35 2001  Jonathan Blandford  <jrb@redhat.com>
        * gtk/gtktreeviewcolumn.h: ditto
 
 2001-12-04  Havoc Pennington  <hp@redhat.com>
-
+       
        * gtk/gtktexttag.c (gtk_text_tag_set_property): add a warning for
        "invisible" property, #65999
 
index 706e17e4c143c439c91df81cd329b3df1f2b9b4a..aeb804e0d245d49b3b5ef87dd434ae35a926a968 100644 (file)
@@ -1,3 +1,44 @@
+2001-12-04  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktextbtree.c (gtk_text_btree_remove_tag_info): remove
+       g_assert_not_reached() that was bogus, since we demand-create the
+       tag info. reported by Chris Phelps
+
+        Jump through assorted hoops to fix bug from Chris Phelps where 
+       removing tags from the table resulted in btree trying to 
+       access tag->table
+       
+       * gtk/gtktextbuffer.c: set up mechanics of adding/removing 
+       ourselves to the tag table
+
+       * gtk/gtktexttagtable.c (_gtk_text_tag_table_add_buffer) 
+       (_gtk_text_tag_table_remove_buffer): private cruft to 
+       let us notify buffer of disappearing tags
+
+       * gtk/gtktexttag.h: remove BTreeNode typedef from this public
+       header, put it in tagprivate    
+
+       * gtk/gtktextbtree.c (_gtk_text_btree_new): don't connect to
+       tag_removed; it's emitted too late.
+       (_gtk_text_btree_notify_will_remove_tag): rename tag_remove_cb to
+       this
+
+       Padding for ABI-compat expansion
+       
+       * gtk/gtktexttag.h (struct _GtkTextAttributes): pad this
+       (struct _GtkTextAppearance): one pad in here too
+
+       * gtk/gtktextlayout.h (struct _GtkTextLayoutClass): padding here
+
+       * gtk/gtktextview.h (struct _GtkTextViewClass): more padding,
+       since action signals etc. seem pretty likely
+
+       * gtk/gtktextbuffer.h (struct _GtkTextBufferClass): padding
+
+       * gtk/gtktexttag.h (struct _GtkTextTagClass): padding
+
+       * gtk/gtktexttagtable.h (struct _GtkTextTagTableClass): padding
+
 2001-12-04  Matthias Clasen  <matthiasc@poet.de>
 
         * gdk/gdkcolor.h (gdk_colormap_change): Deprecate. (#65851)
@@ -26,7 +67,7 @@ Tue Dec  4 18:38:35 2001  Jonathan Blandford  <jrb@redhat.com>
        * gtk/gtktreeviewcolumn.h: ditto
 
 2001-12-04  Havoc Pennington  <hp@redhat.com>
-
+       
        * gtk/gtktexttag.c (gtk_text_tag_set_property): add a warning for
        "invisible" property, #65999
 
index 706e17e4c143c439c91df81cd329b3df1f2b9b4a..aeb804e0d245d49b3b5ef87dd434ae35a926a968 100644 (file)
@@ -1,3 +1,44 @@
+2001-12-04  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktextbtree.c (gtk_text_btree_remove_tag_info): remove
+       g_assert_not_reached() that was bogus, since we demand-create the
+       tag info. reported by Chris Phelps
+
+        Jump through assorted hoops to fix bug from Chris Phelps where 
+       removing tags from the table resulted in btree trying to 
+       access tag->table
+       
+       * gtk/gtktextbuffer.c: set up mechanics of adding/removing 
+       ourselves to the tag table
+
+       * gtk/gtktexttagtable.c (_gtk_text_tag_table_add_buffer) 
+       (_gtk_text_tag_table_remove_buffer): private cruft to 
+       let us notify buffer of disappearing tags
+
+       * gtk/gtktexttag.h: remove BTreeNode typedef from this public
+       header, put it in tagprivate    
+
+       * gtk/gtktextbtree.c (_gtk_text_btree_new): don't connect to
+       tag_removed; it's emitted too late.
+       (_gtk_text_btree_notify_will_remove_tag): rename tag_remove_cb to
+       this
+
+       Padding for ABI-compat expansion
+       
+       * gtk/gtktexttag.h (struct _GtkTextAttributes): pad this
+       (struct _GtkTextAppearance): one pad in here too
+
+       * gtk/gtktextlayout.h (struct _GtkTextLayoutClass): padding here
+
+       * gtk/gtktextview.h (struct _GtkTextViewClass): more padding,
+       since action signals etc. seem pretty likely
+
+       * gtk/gtktextbuffer.h (struct _GtkTextBufferClass): padding
+
+       * gtk/gtktexttag.h (struct _GtkTextTagClass): padding
+
+       * gtk/gtktexttagtable.h (struct _GtkTextTagTableClass): padding
+
 2001-12-04  Matthias Clasen  <matthiasc@poet.de>
 
         * gdk/gdkcolor.h (gdk_colormap_change): Deprecate. (#65851)
@@ -26,7 +67,7 @@ Tue Dec  4 18:38:35 2001  Jonathan Blandford  <jrb@redhat.com>
        * gtk/gtktreeviewcolumn.h: ditto
 
 2001-12-04  Havoc Pennington  <hp@redhat.com>
-
+       
        * gtk/gtktexttag.c (gtk_text_tag_set_property): add a warning for
        "invisible" property, #65999
 
index 706e17e4c143c439c91df81cd329b3df1f2b9b4a..aeb804e0d245d49b3b5ef87dd434ae35a926a968 100644 (file)
@@ -1,3 +1,44 @@
+2001-12-04  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktextbtree.c (gtk_text_btree_remove_tag_info): remove
+       g_assert_not_reached() that was bogus, since we demand-create the
+       tag info. reported by Chris Phelps
+
+        Jump through assorted hoops to fix bug from Chris Phelps where 
+       removing tags from the table resulted in btree trying to 
+       access tag->table
+       
+       * gtk/gtktextbuffer.c: set up mechanics of adding/removing 
+       ourselves to the tag table
+
+       * gtk/gtktexttagtable.c (_gtk_text_tag_table_add_buffer) 
+       (_gtk_text_tag_table_remove_buffer): private cruft to 
+       let us notify buffer of disappearing tags
+
+       * gtk/gtktexttag.h: remove BTreeNode typedef from this public
+       header, put it in tagprivate    
+
+       * gtk/gtktextbtree.c (_gtk_text_btree_new): don't connect to
+       tag_removed; it's emitted too late.
+       (_gtk_text_btree_notify_will_remove_tag): rename tag_remove_cb to
+       this
+
+       Padding for ABI-compat expansion
+       
+       * gtk/gtktexttag.h (struct _GtkTextAttributes): pad this
+       (struct _GtkTextAppearance): one pad in here too
+
+       * gtk/gtktextlayout.h (struct _GtkTextLayoutClass): padding here
+
+       * gtk/gtktextview.h (struct _GtkTextViewClass): more padding,
+       since action signals etc. seem pretty likely
+
+       * gtk/gtktextbuffer.h (struct _GtkTextBufferClass): padding
+
+       * gtk/gtktexttag.h (struct _GtkTextTagClass): padding
+
+       * gtk/gtktexttagtable.h (struct _GtkTextTagTableClass): padding
+
 2001-12-04  Matthias Clasen  <matthiasc@poet.de>
 
         * gdk/gdkcolor.h (gdk_colormap_change): Deprecate. (#65851)
@@ -26,7 +67,7 @@ Tue Dec  4 18:38:35 2001  Jonathan Blandford  <jrb@redhat.com>
        * gtk/gtktreeviewcolumn.h: ditto
 
 2001-12-04  Havoc Pennington  <hp@redhat.com>
-
+       
        * gtk/gtktexttag.c (gtk_text_tag_set_property): add a warning for
        "invisible" property, #65999
 
index 706e17e4c143c439c91df81cd329b3df1f2b9b4a..aeb804e0d245d49b3b5ef87dd434ae35a926a968 100644 (file)
@@ -1,3 +1,44 @@
+2001-12-04  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktextbtree.c (gtk_text_btree_remove_tag_info): remove
+       g_assert_not_reached() that was bogus, since we demand-create the
+       tag info. reported by Chris Phelps
+
+        Jump through assorted hoops to fix bug from Chris Phelps where 
+       removing tags from the table resulted in btree trying to 
+       access tag->table
+       
+       * gtk/gtktextbuffer.c: set up mechanics of adding/removing 
+       ourselves to the tag table
+
+       * gtk/gtktexttagtable.c (_gtk_text_tag_table_add_buffer) 
+       (_gtk_text_tag_table_remove_buffer): private cruft to 
+       let us notify buffer of disappearing tags
+
+       * gtk/gtktexttag.h: remove BTreeNode typedef from this public
+       header, put it in tagprivate    
+
+       * gtk/gtktextbtree.c (_gtk_text_btree_new): don't connect to
+       tag_removed; it's emitted too late.
+       (_gtk_text_btree_notify_will_remove_tag): rename tag_remove_cb to
+       this
+
+       Padding for ABI-compat expansion
+       
+       * gtk/gtktexttag.h (struct _GtkTextAttributes): pad this
+       (struct _GtkTextAppearance): one pad in here too
+
+       * gtk/gtktextlayout.h (struct _GtkTextLayoutClass): padding here
+
+       * gtk/gtktextview.h (struct _GtkTextViewClass): more padding,
+       since action signals etc. seem pretty likely
+
+       * gtk/gtktextbuffer.h (struct _GtkTextBufferClass): padding
+
+       * gtk/gtktexttag.h (struct _GtkTextTagClass): padding
+
+       * gtk/gtktexttagtable.h (struct _GtkTextTagTableClass): padding
+
 2001-12-04  Matthias Clasen  <matthiasc@poet.de>
 
         * gdk/gdkcolor.h (gdk_colormap_change): Deprecate. (#65851)
@@ -26,7 +67,7 @@ Tue Dec  4 18:38:35 2001  Jonathan Blandford  <jrb@redhat.com>
        * gtk/gtktreeviewcolumn.h: ditto
 
 2001-12-04  Havoc Pennington  <hp@redhat.com>
-
+       
        * gtk/gtktexttag.c (gtk_text_tag_set_property): add a warning for
        "invisible" property, #65999
 
index 706e17e4c143c439c91df81cd329b3df1f2b9b4a..aeb804e0d245d49b3b5ef87dd434ae35a926a968 100644 (file)
@@ -1,3 +1,44 @@
+2001-12-04  Havoc Pennington  <hp@redhat.com>
+
+       * gtk/gtktextbtree.c (gtk_text_btree_remove_tag_info): remove
+       g_assert_not_reached() that was bogus, since we demand-create the
+       tag info. reported by Chris Phelps
+
+        Jump through assorted hoops to fix bug from Chris Phelps where 
+       removing tags from the table resulted in btree trying to 
+       access tag->table
+       
+       * gtk/gtktextbuffer.c: set up mechanics of adding/removing 
+       ourselves to the tag table
+
+       * gtk/gtktexttagtable.c (_gtk_text_tag_table_add_buffer) 
+       (_gtk_text_tag_table_remove_buffer): private cruft to 
+       let us notify buffer of disappearing tags
+
+       * gtk/gtktexttag.h: remove BTreeNode typedef from this public
+       header, put it in tagprivate    
+
+       * gtk/gtktextbtree.c (_gtk_text_btree_new): don't connect to
+       tag_removed; it's emitted too late.
+       (_gtk_text_btree_notify_will_remove_tag): rename tag_remove_cb to
+       this
+
+       Padding for ABI-compat expansion
+       
+       * gtk/gtktexttag.h (struct _GtkTextAttributes): pad this
+       (struct _GtkTextAppearance): one pad in here too
+
+       * gtk/gtktextlayout.h (struct _GtkTextLayoutClass): padding here
+
+       * gtk/gtktextview.h (struct _GtkTextViewClass): more padding,
+       since action signals etc. seem pretty likely
+
+       * gtk/gtktextbuffer.h (struct _GtkTextBufferClass): padding
+
+       * gtk/gtktexttag.h (struct _GtkTextTagClass): padding
+
+       * gtk/gtktexttagtable.h (struct _GtkTextTagTableClass): padding
+
 2001-12-04  Matthias Clasen  <matthiasc@poet.de>
 
         * gdk/gdkcolor.h (gdk_colormap_change): Deprecate. (#65851)
@@ -26,7 +67,7 @@ Tue Dec  4 18:38:35 2001  Jonathan Blandford  <jrb@redhat.com>
        * gtk/gtktreeviewcolumn.h: ditto
 
 2001-12-04  Havoc Pennington  <hp@redhat.com>
-
+       
        * gtk/gtktexttag.c (gtk_text_tag_set_property): add a warning for
        "invisible" property, #65999
 
index 44cf702c3ccce09791534d7f2a85fc8132fb64bf..87713ff40b41f131f9141c8b0dbf8d2ad558e49e 100644 (file)
@@ -184,7 +184,7 @@ struct _GtkTextBTree {
   BTreeView *views;
   GSList *tag_infos;
   guint tag_changed_handler;
-  guint tag_removed_handler;
+
   /* Incremented when a segment with a byte size > 0
    * is added to or removed from the tree (i.e. the
    * length of a line may have changed, and lines may
@@ -315,9 +315,6 @@ static void tag_changed_cb        (GtkTextTagTable  *table,
                                    GtkTextTag       *tag,
                                    gboolean          size_changed,
                                    GtkTextBTree     *tree);
-static void tag_removed_cb        (GtkTextTagTable  *table,
-                                   GtkTextTag       *tag,
-                                   GtkTextBTree     *tree);
 static void cleanup_line          (GtkTextLine      *line);
 static void recompute_node_counts (GtkTextBTree     *tree,
                                    GtkTextBTreeNode *node);
@@ -436,11 +433,6 @@ _gtk_text_btree_new (GtkTextTagTable *table,
                                                G_CALLBACK (tag_changed_cb),
                                                tree);
 
-  tree->tag_removed_handler = g_signal_connect (G_OBJECT (tree->table),
-                                               "tag_removed",
-                                               G_CALLBACK (tag_removed_cb),
-                                               tree);
-
   tree->mark_table = g_hash_table_new (g_str_hash, g_str_equal);
   tree->child_anchor_table = NULL;
   
@@ -519,9 +511,6 @@ _gtk_text_btree_unref (GtkTextBTree *tree)
       g_signal_handler_disconnect (G_OBJECT (tree->table),
                                    tree->tag_changed_handler);
 
-      g_signal_handler_disconnect (G_OBJECT (tree->table),
-                                   tree->tag_removed_handler);
-
       g_object_unref (G_OBJECT (tree->table));
 
       g_free (tree);
@@ -5480,10 +5469,9 @@ tag_changed_cb (GtkTextTagTable *table,
     }
 }
 
-static void
-tag_removed_cb (GtkTextTagTable *table,
-                GtkTextTag *tag,
-                GtkTextBTree *tree)
+void
+_gtk_text_btree_notify_will_remove_tag (GtkTextBTree    *tree,
+                                        GtkTextTag      *tag)
 {
   /* Remove the tag from the tree */
 
@@ -5852,9 +5840,6 @@ gtk_text_btree_remove_tag_info (GtkTextBTree *tree,
 
       list = g_slist_next (list);
     }
-
-  g_assert_not_reached ();
-  return;
 }
 
 static void
index 2736fa6988bf56e2dcb92d4ce6ff1832efb43f98..5b0b6c2b0cec746825e029a47b2b980fecdae23c 100644 (file)
@@ -292,6 +292,10 @@ void _gtk_change_node_toggle_count  (GtkTextBTreeNode   *node,
 void _gtk_text_btree_release_mark_segment (GtkTextBTree       *tree,
                                            GtkTextLineSegment *segment);
 
+/* for coordination with the tag table */
+void _gtk_text_btree_notify_will_remove_tag (GtkTextBTree *tree,
+                                             GtkTextTag   *tag);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 011bedf73b10f7da1fb900dbac6db35622c97319..715153c9ad09cfe5b5c6795c2e6471baec1026ad 100644 (file)
@@ -327,6 +327,8 @@ gtk_text_buffer_new (GtkTextTagTable *table)
       text_buffer->tag_table = table;
 
       g_object_ref (G_OBJECT (text_buffer->tag_table));
+
+      _gtk_text_tag_table_add_buffer (table, text_buffer);
     }
   
   return text_buffer;
@@ -344,6 +346,7 @@ gtk_text_buffer_finalize (GObject *object)
 
   if (buffer->tag_table)
     {
+      _gtk_text_tag_table_remove_buffer (buffer->tag_table, buffer);
       g_object_unref (G_OBJECT (buffer->tag_table));
       buffer->tag_table = NULL;
     }
@@ -366,7 +369,10 @@ static GtkTextTagTable*
 get_table (GtkTextBuffer *buffer)
 {
   if (buffer->tag_table == NULL)
-    buffer->tag_table = gtk_text_tag_table_new ();
+    {
+      buffer->tag_table = gtk_text_tag_table_new ();
+      _gtk_text_tag_table_add_buffer (buffer->tag_table, buffer);
+    }
 
   return buffer->tag_table;
 }
@@ -376,7 +382,7 @@ get_btree (GtkTextBuffer *buffer)
 {
   if (buffer->btree == NULL)
     buffer->btree = _gtk_text_btree_new (gtk_text_buffer_get_tag_table (buffer),
-                                        buffer);
+                                         buffer);
 
   return buffer->btree;
 }
@@ -3502,6 +3508,19 @@ _gtk_text_buffer_get_line_log_attrs (GtkTextBuffer     *buffer,
   return cache->entries[0].attrs;
 }
 
+void
+_gtk_text_buffer_notify_will_remove_tag (GtkTextBuffer *buffer,
+                                         GtkTextTag    *tag)
+{
+  /* This removes tag from the buffer, but DOESN'T emit the
+   * remove_tag signal, because we can't afford to have user
+   * code messing things up at this point; the tag MUST be removed
+   * entirely.
+   */
+  if (buffer->btree)
+    _gtk_text_btree_notify_will_remove_tag (buffer->btree, tag);
+}
+
 /*
  * Debug spew
  */
@@ -3511,8 +3530,3 @@ _gtk_text_buffer_spew (GtkTextBuffer *buffer)
 {
   _gtk_text_btree_spew (get_btree (buffer));
 }
-
-
-
-
-
index 24311f8885e2a0d570eb60c67e83a9aa9ebfbd5e..d2cf2c7448a3cd9d58b3be1892cd3a257f225244 100644 (file)
@@ -125,6 +125,13 @@ struct _GtkTextBufferClass
   /* Called at the start and end of an atomic user action */
   void (* begin_user_action)  (GtkTextBuffer *buffer);
   void (* end_user_action)    (GtkTextBuffer *buffer);
+
+  GtkFunction pad1;
+  GtkFunction pad2;
+  GtkFunction pad3;
+  GtkFunction pad4;
+  GtkFunction pad5;
+  GtkFunction pad6;
 };
 
 GType        gtk_text_buffer_get_type       (void) G_GNUC_CONST;
@@ -361,6 +368,9 @@ const PangoLogAttr* _gtk_text_buffer_get_line_log_attrs (GtkTextBuffer     *buff
                                                          const GtkTextIter *anywhere_in_line,
                                                          gint              *char_len);
 
+void _gtk_text_buffer_notify_will_remove_tag (GtkTextBuffer *buffer,
+                                              GtkTextTag    *tag);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 81881ef18deeba44f31dfb90af03f6a782e41e08..5e52f7d32b3b3178d657f450f8ac1b38e37611a0 100644 (file)
@@ -205,6 +205,9 @@ struct _GtkTextLayoutClass
                                  GtkWidget         *child,
                                  gint               x,
                                  gint               y);
+
+  GtkFunction pad1;
+  GtkFunction pad2;
 };
 
 struct _GtkTextAttrAppearance
index 3020e8b6e5d18182cbb7b3d5ac0b384543186e28..544c0955dca31d6c74b24eba7637bc58ea9f8c15 100644 (file)
@@ -9,7 +9,6 @@ extern "C" {
 #endif /* __cplusplus */
 
 typedef struct _GtkTextIter GtkTextIter;
-typedef struct _GtkTextBTreeNode GtkTextBTreeNode;
 typedef struct _GtkTextTagTable GtkTextTagTable;
 
 typedef struct _GtkTextAttributes GtkTextAttributes;
@@ -47,7 +46,7 @@ struct _GtkTextTag
    */
 
   GtkTextAttributes *values;
-
+  
   /* Flags for whether a given value is set; if a value is unset, then
    * this tag does not affect it.
    */
@@ -85,6 +84,9 @@ struct _GtkTextTagClass
                       GObject           *event_object, /* widget, canvas item, whatever */
                       GdkEvent          *event,        /* the event itself */
                       const GtkTextIter *iter);        /* location of event in buffer */
+
+  GtkFunction pad1;
+  GtkFunction pad2;
 };
 
 GType        gtk_text_tag_get_type     (void) G_GNUC_CONST;
@@ -112,6 +114,11 @@ struct _GtkTextAppearance
 
   /* super/subscript rise, can be negative */
   gint rise;
+
+  /* I'm not sure this can really be used without breaking some things
+   * an app might do :-/
+   */
+  gpointer padding1;
   
   guint underline : 4;          /* PangoUnderline */
   guint strikethrough : 1;
@@ -129,6 +136,11 @@ struct _GtkTextAppearance
    */
   guint inside_selection : 1;
   guint is_text : 1;
+
+  guint pad1 : 1;
+  guint pad2 : 1;
+  guint pad3 : 1;
+  guint pad4 : 1;
 };
 
 struct _GtkTextAttributes
@@ -166,6 +178,11 @@ struct _GtkTextAttributes
 
   PangoLanguage *language;
 
+  /* I'm not sure this can really be used without breaking some things
+   * an app might do :-/
+   */
+  gpointer padding1;
+  
   /* hide the text  */
   guint invisible : 1;
 
index a7305f5c428eab184e77ca9c1e07e329c9864369..20c0ae5c54be1d9f145b4978fd6c6c19a07b364c 100644 (file)
@@ -3,6 +3,8 @@
 
 #include <gtk/gtktexttag.h>
 
+typedef struct _GtkTextBTreeNode GtkTextBTreeNode;
+
 /* values should already have desired defaults; this function will override
  * the defaults with settings in the given tags, which should be sorted in
  * ascending order of priority
index 7336e792fd9e17d8f4fa5aa8b0a9bde1c7f3eff2..70c690092d41caf210ff9f9658328eda74334342 100644 (file)
@@ -2,6 +2,7 @@
 #include "gtktexttagtable.h"
 #include "gtkmarshalers.h"
 #include "gtksignal.h"
+#include "gtktextbuffer.h" /* just for the lame notify_will_remove_tag hack */
 
 #include <stdlib.h>
 
@@ -154,6 +155,8 @@ gtk_text_tag_table_finalize (GObject *object)
   g_hash_table_destroy (table->hash);
   g_slist_free (table->anonymous);
 
+  g_slist_free (table->buffers);
+  
   (* G_OBJECT_CLASS (parent_class)->finalize) (object);
 }
 static void
@@ -277,10 +280,24 @@ void
 gtk_text_tag_table_remove (GtkTextTagTable *table,
                            GtkTextTag      *tag)
 {
+  GSList *tmp;
+  
   g_return_if_fail (GTK_IS_TEXT_TAG_TABLE (table));
   g_return_if_fail (GTK_IS_TEXT_TAG (tag));
   g_return_if_fail (tag->table == table);
 
+  /* Our little bad hack to be sure buffers don't still have the tag
+   * applied to text in the buffer
+   */
+  tmp = table->buffers;
+  while (tmp != NULL)
+    {
+      _gtk_text_buffer_notify_will_remove_tag (GTK_TEXT_BUFFER (tmp->data),
+                                               tag);
+      
+      tmp = tmp->next;
+    }
+  
   /* Set ourselves to the highest priority; this means
      when we're removed, there won't be any gaps in the
      priorities of the tags in the table. */
@@ -368,3 +385,21 @@ gtk_text_tag_table_get_size (GtkTextTagTable *table)
 
   return g_hash_table_size (table->hash) + table->anon_count;
 }
+
+void
+_gtk_text_tag_table_add_buffer (GtkTextTagTable *table,
+                                gpointer         buffer)
+{
+  g_return_if_fail (GTK_IS_TEXT_TAG_TABLE (table));
+
+  table->buffers = g_slist_prepend (table->buffers, buffer);
+}
+
+void
+_gtk_text_tag_table_remove_buffer (GtkTextTagTable *table,
+                                   gpointer         buffer)
+{
+  g_return_if_fail (GTK_IS_TEXT_TAG_TABLE (table));
+
+  table->buffers = g_slist_remove (table->buffers, buffer);
+}
index 32abde03638e855fd8e27d5ea543eab43626e83d..4e0a4d9f86bfa86ae2694f7bb3093753a27d5238 100644 (file)
@@ -26,6 +26,8 @@ struct _GtkTextTagTable {
   GHashTable *hash;
   GSList *anonymous;
   gint anon_count;
+
+  GSList *buffers;
 };
 
 struct _GtkTextTagTableClass {
@@ -34,6 +36,9 @@ struct _GtkTextTagTableClass {
   void (* tag_changed) (GtkTextTagTable *table, GtkTextTag *tag, gboolean size_changed);
   void (* tag_added) (GtkTextTagTable *table, GtkTextTag *tag);
   void (* tag_removed) (GtkTextTagTable *table, GtkTextTag *tag);
+
+  GtkFunction pad1;
+  GtkFunction pad2;
 };
 
 GType          gtk_text_tag_table_get_type (void) G_GNUC_CONST;
@@ -51,6 +56,14 @@ void             gtk_text_tag_table_foreach  (GtkTextTagTable        *table,
 gint             gtk_text_tag_table_get_size (GtkTextTagTable        *table);
 
 
+/* INTERNAL private stuff - not even exported from the library on
+ * many platforms
+ */
+void _gtk_text_tag_table_add_buffer    (GtkTextTagTable *table,
+                                        gpointer         buffer);
+void _gtk_text_tag_table_remove_buffer (GtkTextTagTable *table,
+                                        gpointer         buffer);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index 33b17e8adc269ea0c9e1d2f811779d6091f09cb1..bc755b3fa6ba5b51d5ade3e13043f5713632d8e9 100644 (file)
@@ -189,6 +189,11 @@ struct _GtkTextViewClass
   GtkFunction pad2;
   GtkFunction pad3;
   GtkFunction pad4;
+  
+  GtkFunction pad5;
+  GtkFunction pad6;
+  GtkFunction pad7;
+  GtkFunction pad8;
 };
 
 GtkType        gtk_text_view_get_type              (void) G_GNUC_CONST;